attribute vec3 color; 
attribute vec3 normal; 
attribute vec3 position; 

uniform vec3 uLightPos;			//	light position in eye space
uniform mat4 modelMatrix;			//
uniform mat4 lightViewMatrix;		//	view matrix for system which uses the light source as the camera position
uniform mat4 lightProjectionMatrix;	//	projection matrix for system which uses the light source as the camera position

uniform mat4 eyeViewMatrix;			//	view matrix for system which uses the eye as the camera position
uniform mat4 eyeProjectionMatrix;	//	projection matrix for system which uses the eye as the camera position

varying vec3 pColor;
varying vec4 pShadowCoord;			//	coordinate in the system which uses the light source as the camera position

varying vec3 pEyeVec;			//	vertex_to_eye vector
varying vec3 pLightDir;			//	light_to_vertex vector
varying vec3 pNormal;	

void main()
{ 
	pColor = color; 
	gl_Position = eyeProjectionMatrix * eyeViewMatrix * modelMatrix * vec4(position, 1.0);
	pShadowCoord = lightProjectionMatrix * lightViewMatrix * modelMatrix * vec4(position, 1.0);
	
	vec3 vertexPos = normalize((eyeViewMatrix * modelMatrix * vec4(position, 1.0)).xyz);
	vec3 lightPos = normalize((eyeViewMatrix * vec4(uLightPos, 1.0)).xyz);
	pLightDir = vertexPos - lightPos;
	pEyeVec = 0 - vertexPos;
	pNormal = normal;
}
